package cn.pugle.oj.leetcode;

import cn.pugle.oj.catalog.TreeProblem;

/**
 * https://leetcode.com/problems/maximum-depth-of-binary-tree/
 *
 * @author tzp
 * @since 2020/10/13
 */
public class LC104 implements TreeProblem {
    public int maxDepth(TreeNode root) {
        if (root == null) return 0;
        return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
    }
}
